package br.com.moxirpt.model.vo.obito;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import br.com.moxirpt.form.FormUtil;
import br.com.moxirpt.model.log.Form;
import br.com.moxirpt.model.vo.Resumo;

@SuppressWarnings("serial")
@Entity
@Table(name = "data.vw_obito_resumo")
@NamedQueries({			
	@NamedQuery(name = "ObitoResumoVO.obterResumos", query = "from ObitoResumoVO where pid = :pid"),
	@NamedQuery(name="ObitoResumoVO.obterItensAuditadosPorPid", query="from ObitoResumoVO where pid = :pid"),
	@NamedQuery(name="ObitoResumoVO.obterItensAuditadosPorNumScreening", query="from ObitoResumoVO  where numScreening = :numScreening"),
	
	@NamedQuery(name = "ObitoResumoVO.obterResumosPorSite", query = "from ObitoResumoVO where site = :site"),
	@NamedQuery(name="ObitoResumoVO.obterItensAuditadosPorPidPorSite", query="from ObitoResumoVO where pid = :pid and site = :site"),
	@NamedQuery(name="ObitoResumoVO.obterItensAuditadosPorNumScreeningPorSite", query="from ObitoResumoVO  where numScreening = :numScreening and site = :site")
})
public class ObitoResumoVO implements Resumo, Serializable {

	@Id
	@Column(name = "idobito", nullable = false)
	private int idObito;
	
	@Column(name = "idinclusao", nullable = false)
	private int idInclusao;
	
	@Column(name = "pid", nullable = false)
	private int pid;
	
	@Column(name = "site", nullable = false)
	private Integer site;
	
	@Column(name = "numscreening", nullable = false)
	private String numScreening;
	
	@Transient
	private Integer indice = null;
	
	@Column(name = "dtinclusao", nullable = false)
	@Temporal(TemporalType.DATE)
	private Date dtInclusao;
	
	@Transient
	private String identificacao = null;
	
	
	public int getIdObito() {
		return idObito;
	}

	public void setIdObito(int idObito) {
		this.idObito = idObito;
	}

	public int getIdInclusao() {
		return idInclusao;
	}

	public void setIdInclusao(int idInclusao) {
		this.idInclusao = idInclusao;
	}

	public Integer getIndice() {
		return indice;
	}

	public void setIndice(Integer indice) {
		this.indice = indice;
	}

	public Date getDtInclusao() {
		return dtInclusao;
	}

	public void setDtInclusao(Date dtInclusao) {
		this.dtInclusao = dtInclusao;
	}

	public String getIdentificacao() {
		return identificacao;
	}

	public void setIdentificacao(String identificacao) {
		this.identificacao = identificacao;
	}

	public void setPid(int pid) {
		this.pid = pid;
	}



	public String getNumScreening() {
		return numScreening;
	}

	public void setNumScreening(String numScreening) {
		this.numScreening = numScreening;
	}

	public Integer getSite() {
		return site;
	}

	public void setSite(Integer site) {
		this.site = site;
	}
	
	@Override
	public int getPid() {

		return pid;
		
	}

	@Override
	public int getId() {

		return getIdObito();
		
	}
	
	@Override
	public Form getForm(){
		return FormUtil.FormsEnum.OBITO.getForm();
	}

}
